{autoslider.core} is a newly open-sourced package for automatically creating standard study outputs and adding them to PowerPoint slides.
TLG
Author
Stefan P. Thoma, Joe Zhu
Published
March 14, 2025
We are excited to announce that the GitHub - insightsengineering/autoslider.core: autoslideR core {autoslider.core} package is now a part of pharmaverse!
The normal process of creating clinical study slides is that a statistician manually types in numbers from outputs and a separate statistician then double checks the typed-in numbers. This process is time consuming, resource intensive, and error prone. This package lets users create slides with study-specific outputs in an automated and reproducible way – without the need to copy-paste. It reduces the amount of work and the required time when creating slides, and reduces the risk of errors from manually typing or copying numbers from the output to slides. It also helps users to avoid unnecessary stress when creating large amounts of slide decks in a short time window. It is particularly helpful for slides that need to be continuously created with updated data, such as slides needed for dose-escalation meetings.
The autoslider development work started as a Roche internal initiative. As it grew over the years, it was well received and we decided to open-source this package while at the same time not causing any downstream breaking changes to our internal users. Therefore, the autoslider package became two layers, the outer layer exposed to internal users remains as autoslider. It now mostly contains Roche-specific formats, layouts and designs. The inner layer, aka GitHub - insightsengineering/autoslider.core: autoslideR core {autoslider.core}, which controls the rendering and workflow, is open source and fully functional and user-facing on its own. We consider autoslider as a framework, and would like to invite users to build their own autoslider.* packages. You can find t0he developer guidelines at the package homepage.
The value proposition of the GitHub - insightsengineering/autoslider.core: autoslideR core {autoslider.core} package is two-fold:
functions to create standard outputs with (some) inbuilt customization capability
back-end machinery to manage the workflow. This includes:
creating outputs from a specification file
filtering data according to a specification file
decorating outputs (think: footnotes & titles)
adding these outputs to a PowerPoint slide deck, including pagination.
In this blog post, we will guide you through the GitHub - insightsengineering/autoslider.core: autoslideR core {autoslider.core} package and demonstrate how it can be used to streamline your data analysis and output slide generation.
Requirements
To follow along with this tutorial, you need to have the GitHub - insightsengineering/autoslider.core: autoslideR core {autoslider.core} package installed. You will also need data available in ADaM format (or SDTM, depending on the template used), which should be stored in a named list where the names correspond to ADaM datasets.
library(autoslider.core)
Registered S3 method overwritten by 'tern':
method from
tidy.glm broom
library(dplyr)
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
Workflow
To get started, the folder structure for your project could look something like this:
The GitHub - insightsengineering/autoslider.core: autoslideR core {autoslider.core} workflow would involve implementing the key aspects in the run_script.R file. This script guides through the workflow without needing the files in R/. However, custom output-creating functions can be stored in the R/ folder.
Specifications (specs.yml)
This file contains the specifications of all outputs you want to create. Each output includes details such as the program name, footnotes & titles, paper orientation and font size, suffix, and additional arguments.
The following example specs.yml content would create two outputs based off of two template functions, t_ds_slide() and t_dm_slide():
In the filters.yml file, the names of the filters used across outputs are specified. Each filter includes a name, title, filtering condition, target dataset, and type.
The following example filters.yml file specifies four commonly used filters:
An overview of all GitHub - insightsengineering/autoslider.core: autoslideR core {autoslider.core} functions can be found here. Custom functions can be created if the built-in functions do not meet your needs.
Backend Machinery
A typical workflow involves defining paths to the YAML files, loading the filters, reading the data, creating the outputs based on the specifications, and decorating the outputs with titles and footnotes. Example code for setting up the workflow:
# define path to the yml filesspec_file <-"spec.yml"filters <-"filters.yml"
library("dplyr")# load all filtersfilters::load_filters(filters, overwrite =TRUE)# read datadata <-list("adsl"= eg_adsl %>%mutate(FASFL = SAFFL, # add FASFL for illustrative purpose for t_pop_slide# DISTRTFL is needed for t_ds_slide but is missing in example dataDISTRTFL =sample(c("Y", "N"), size =length(TRT01A), replace =TRUE, prob =c(.1, .9)) ) %>%preprocess_t_ds(), # this preproccessing is required by one of the autoslider.core functions"adae"= eg_adae,"adtte"= eg_adtte,"adrs"= eg_adrs,"adlb"= eg_adlb)# create outputs based on the specs and the functionsoutputs <- spec_file %>%read_spec() %>%filter_spec(., program %in%c("t_ds_slide", "t_dm_slide")) %>%generate_outputs(datasets = data) %>%decorate_outputs(version_label =NULL)
✔ 2/3 outputs matched the filter condition `program %in% c("t_ds_slide", "t_dm_slide")`.
❯ Running program `t_ds_slide` with suffix 'ITT'.
Filter 'ITT' matched target ADSL.
400/400 records matched the filter condition `ITTFL == 'Y'`.
❯ Running program `t_dm_slide` with suffix 'ITT'.
Filter 'ITT' matched target ADSL.
400/400 records matched the filter condition `ITTFL == 'Y'`.
Example of saving outputs to a slide:
# Output to slides with template and color themeoutputs %>%generate_slides(outfile =tempfile(fileext =".pptx"),template =file.path(system.file(package ="autoslider.core"), "/theme/basic.pptx"),table_format = autoslider_format )
[1] " Patient Disposition (Intent to Treat Population)"
[1] " Patient Disposition (Intent to Treat Population) (cont.)"
[1] " Patient Demographics and Baseline Characteristics, Intent to Treat Population"
[1] " Patient Demographics and Baseline Characteristics, Intent to Treat Population (cont.)"
[1] " Patient Demographics and Baseline Characteristics, Intent to Treat Population (cont.)"
[1] " Patient Demographics and Baseline Characteristics, Intent to Treat Population (cont.)"
Writing Custom Functions
For study-specific outputs not covered by GitHub - insightsengineering/autoslider.core: autoslideR core {autoslider.core} functions, you can create custom functions. Custom functions need to return either a Create Elegant Data Visualisations Using the Grammar of Graphics • ggplot2 {ggplot2} (for plots), GitHub - insightsengineering/rtables: Reporting tables with R {rtables} (for tables), or rlistings {rlistings} or data.frame objects (for listings).
Visit
Analysis Reference Range Indicator A: Drug X B: Placebo C: Combination
Baseline Status (N=134) (N=134) (N=132)
———————————————————————————————————————————————————————————————————————————————————————
WEEK 1 DAY 8
Low
Not low 16/119 (13.4%) 22/113 (19.5%) 24/112 (21.4%)
Low 2/15 (13.3%) 2/21 (9.5%) 7/20 (35%)
Total 18/134 (13.4%) 24/134 (17.9%) 31/132 (23.5%)
High
Not high 21/114 (18.4%) 20/112 (17.9%) 17/115 (14.8%)
High 2/20 (10%) 4/22 (18.2%) 3/17 (17.6%)
Total 23/134 (17.2%) 24/134 (17.9%) 20/132 (15.2%)
WEEK 2 DAY 15
Low
Not low 26/119 (21.8%) 20/113 (17.7%) 12/112 (10.7%)
Low 2/15 (13.3%) 3/21 (14.3%) 4/20 (20%)
Total 28/134 (20.9%) 23/134 (17.2%) 16/132 (12.1%)
High
Not high 15/114 (13.2%) 17/112 (15.2%) 15/115 (13%)
High 2/20 (10%) 4/22 (18.2%) 4/17 (23.5%)
Total 17/134 (12.7%) 21/134 (15.7%) 19/132 (14.4%)
WEEK 3 DAY 22
Low
Not low 15/119 (12.6%) 21/113 (18.6%) 18/112 (16.1%)
Low 0/15 3/21 (14.3%) 0/20
Total 15/134 (11.2%) 24/134 (17.9%) 18/132 (13.6%)
High
Not high 22/114 (19.3%) 18/112 (16.1%) 17/115 (14.8%)
High 2/20 (10%) 5/22 (22.7%) 1/17 (5.9%)
Total 24/134 (17.9%) 23/134 (17.2%) 18/132 (13.6%)
WEEK 4 DAY 29
Low
Not low 30/119 (25.2%) 13/113 (11.5%) 16/112 (14.3%)
Low 3/15 (20%) 2/21 (9.5%) 5/20 (25%)
Total 33/134 (24.6%) 15/134 (11.2%) 21/132 (15.9%)
High
Not high 17/114 (14.9%) 11/112 (9.8%) 16/115 (13.9%)
High 2/20 (10%) 6/22 (27.3%) 3/17 (17.6%)
Total 19/134 (14.2%) 17/134 (12.7%) 19/132 (14.4%)
WEEK 5 DAY 36
Low
Not low 17/119 (14.3%) 19/113 (16.8%) 16/112 (14.3%)
Low 2/15 (13.3%) 3/21 (14.3%) 5/20 (25%)
Total 19/134 (14.2%) 22/134 (16.4%) 21/132 (15.9%)
High
Not high 19/114 (16.7%) 17/112 (15.2%) 11/115 (9.6%)
High 4/20 (20%) 6/22 (27.3%) 2/17 (11.8%)
Total 23/134 (17.2%) 23/134 (17.2%) 13/132 (9.8%)
To use the custom function within the GitHub - insightsengineering/autoslider.core: autoslideR core {autoslider.core} workflow, ensure it is available in the global environment:
source("programs/output_functions.R")
With the correct specs.yml and filters.yml, integrate the custom function into the general workflow:
[1] " Patient Disposition (Intent to Treat Population)"
[1] " Patient Disposition (Intent to Treat Population) (cont.)"
[1] " Patient Demographics and Baseline Characteristics, Intent to Treat Population"
[1] " Patient Demographics and Baseline Characteristics, Intent to Treat Population (cont.)"
[1] " Patient Demographics and Baseline Characteristics, Intent to Treat Population (cont.)"
[1] " Patient Demographics and Baseline Characteristics, Intent to Treat Population (cont.)"
[1] " Patient Disposition (Intent to Treat Population)"
[1] " Patient Disposition (Intent to Treat Population) (cont.)"
[1] " Patient Disposition (Intent to Treat Population) (cont.)"
[1] " Patient Disposition (Intent to Treat Population) (cont.)"
[1] " Patient Disposition (Intent to Treat Population) (cont.)"
[1] " Patient Disposition (Intent to Treat Population) (cont.)"
[1] " Patient Disposition (Intent to Treat Population) (cont.)"
[1] " Patient Disposition (Intent to Treat Population) (cont.)"
[1] " Patient Disposition (Intent to Treat Population) (cont.)"
[1] " Patient Disposition (Intent to Treat Population) (cont.)"
We hope this guide helps you get started with GitHub - insightsengineering/autoslider.core: autoslideR core {autoslider.core} in pharmaverse. Happy coding!